package echo_plugin

//
//import (
//	"context"
//	"gitee.com/kristas/booting-go/framework/web"
//	"github.com/labstack/echo/v4"
//	"mime/multipart"
//	"net/http"
//)
//
//type mapperAdapter struct {
//	c echo.Context
//}
//
//func newMapperAdapter(c echo.Context) web.ParamMapper {
//	return &mapperAdapter{c: c}
//}
//
//func (e *mapperAdapter) GetStringFromPath(name string) (string, error) {
//	return e.c.Param(name), nil
//}
//
//func (e *mapperAdapter) GetStringFromQuery(name string) (string, error) {
//	return e.c.QueryParam(name), nil
//}
//
//func (e *mapperAdapter) GetStringFromHeader(name string) (string, error) {
//	return e.c.Request().Header.Get(name), nil
//}
//
//func (e *mapperAdapter) GetStringFromForm(name string) (string, error) {
//	return e.c.FormValue(name), nil
//}
//
//func (e *mapperAdapter) GetMapFromForm() (map[string][]string, error) {
//	return e.c.FormParams()
//}
//
//func (e *mapperAdapter) GetMultipartHeader(param web.Param) (*multipart.FileHeader, error) {
//	return e.c.FormFile(param.GetName())
//}
//
//func (e *mapperAdapter) GetRequest() (*http.Request, error) {
//	return e.c.Request(), nil
//}
//
//func (e *mapperAdapter) GetResponseWriter() (http.ResponseWriter, error) {
//	return e.c.Response(), nil
//}
//
//func (e *mapperAdapter) GetContext() (context.Context, error) {
//	req, err := e.GetRequest()
//	if err != nil {
//		return nil, err
//	}
//	return req.Context(), nil
//}
//
//func (e *mapperAdapter) Get(param web.Param) (interface{}, error) {
//	return map[string]interface{}{
//		"ctx": e.c,
//	}[param.GetSource()], nil
//}
